<template>
  <div id="box">
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      label-width="140px"
      :label-position="labelPosition"
      class="demo-ruleForm"
    >
      <!-- 采购结果维护信息 -->
      <div class="heard">
        <div class="h_left">
          <div>
            <img src="../../../assets/imgs/i2.png" alt="" />
          </div>
          <div class="h_title">采购结果维护信息</div>
          <div>
            <img src="../../../assets/imgs/i4.png" alt="" />
          </div>
        </div>
      </div>
      <!-- 采购结果维护信息 -->
      <div class="declare">
        <el-row :gutter="20">
          <el-col :span="14">
            <el-form-item label="项目名称：" prop="name">
              <span>{{ ruleForm.name }} </span>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 采购类别： -->
        <el-row :gutter="60">
          <el-col :span="8" class="aaa">
            <el-form-item label="采购类别：" prop="type">
              <span>
                {{ son.isgovprocurement }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8" v-if="ruleForm.yusuanjine" class="aaa qwert">
            <el-form-item label="预算金额：" prop="yusuanjine" class="yuanmmp">
              <div>
                {{ formatMoney(parseInt(this.ruleForm.yusuanjine)) }} 元
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="合同类别：">
              <div>
                {{ this.ruleForm.htlb }}
              </div>
            </el-form-item>
          </el-col>

          <!-- <div class="danweiyuan"
               v-if="this.ruleForm.type == '新增电子化平台' || this.ruleForm.type  == '新增10W以下'">
            元
          </div> -->
          <!-- <div class="danweiyuan">
            元
          </div> -->
        </el-row>
        <!-- 合同类别 -->
        <el-row
          :gutter="60"
          v-if="
            son.govprocurement == '新增电子化平台' ||
            son.govprocurement == '电子化平台' ||
            son.govprocurement == '新增10W以下' ||
            son.govprocurement == '新增10W-50W'
          "
        >
          <el-col :span="8">
            <el-form-item label="合同类别：" prop="category">
              <!-- <el-select v-model="ruleForm.category"
                         size="medium"
                         :disabled='son.xiangqing__'
                         placeholder="请选择">
                <el-option v-for="item in options5"
                           :key="item"
                           :label="item"
                           :value="item">
                </el-option>
              </el-select> -->
              {{ ruleForm.category }}
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 开标时间： -->
        <el-row :gutter="60">
          <el-col :span="8" class="aaa">
            <el-form-item label="采购时间：" prop="date_s">
              <div>{{ ruleForm.date_s.substring(0, 10) }}</div>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="8"
                  class="aaa">
            <el-form-item label="开标时间："
                          prop="date_d">
              <el-date-picker v-model="ruleForm.date_d"
                              type="date"
                              placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
          </el-col> -->
          <el-col :span="8" class="aaa qwert">
            <el-form-item
              label="合同金额："
              prop="zhongbiaojine"
              class="yuanmmp"
            >
              {{ ruleForm.zhongbiaojine }} 元
            </el-form-item>
          </el-col>
          <el-col :span="8" v-if="ruleForm.hylx != ''">
            <el-form-item label="会议类型：">
              {{ ruleForm.hylx }}
            </el-form-item>
          </el-col>
          <!-- <div class="danweiyuan">
          </div> -->
        </el-row>
        <!-- 单位名称： -->
        <el-row :gutter="60">
          <el-col :span="8">
            <el-form-item label="单位名称：" prop="danwei_mc">
              {{ ruleForm.danwei_mc }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系人：" prop="lianxi_r">
              {{ ruleForm.lianxi_r }}
            </el-form-item>
          </el-col>
          <!-- <el-col :span="8">
            <el-form-item label="中标供应商性质："
                          prop="zhongbiao_gysxz">
              <el-select v-model="ruleForm.zhongbiao_gysxz"
                         size="medium"
                         placeholder="请选择">
                <el-option v-for="item in options1"
                           :key="item.value"
                           :label="item.label"
                           :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col> -->
        </el-row>
        <!-- 联系电话： -->
        <el-row :gutter="60">
          <el-col :span="8">
            <el-form-item label="联系电话：" prop="lianxi_dh">
              {{ ruleForm.lianxi_dh }}
            </el-form-item>
          </el-col>
          <el-col :span="16">
            <el-form-item label="公司注册地址：" prop="gongshi_zcdz">
              {{ ruleForm.gongshi_zcdz }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="60" v-if=" ruleForm.zhongbiao_jg !=''">
          <el-col :span="8">
            <el-form-item label="招标机构：" prop="">
              {{ ruleForm.zhongbiao_jg }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="招标机构联系人：" prop="">
              {{ ruleForm.zbjglxr }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系电话：" prop="">
              {{ ruleForm.zbjglxjg }}
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 委托授权签订时间 -->
        <!-- <el-row :gutter="60">
          <el-col :span="8">
            <el-form-item label="委托授权签订时间:"
                          prop="weituosouquan_date">
              <el-date-picker v-model="ruleForm.weituosouquan_date"
                              type="date"
                              placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="招标机构:"
                          prop="zhaobiao_jg">
              <el-input v-model="ruleForm.zhaobiao_jg"></el-input>
            </el-form-item>
          </el-col>

        </el-row> -->
        <!-- 上传文件 -->
        <section class="sections">
          <!-- <p class="i">
            <i class="el-icon-upload">&nbsp;</i>上传文件
          </p> -->
        </section>
      </div>
      <!-- 合同维护信息 -->
      <div class="heard" style="margin-top: 35px">
        <div class="h_left">
          <div>
            <img src="../../../assets/imgs/i1.png" alt="" />
          </div>
          <div class="h_title">合同维护信息</div>
          <div>
            <img src="../../../assets/imgs/i4.png" alt="" />
          </div>
        </div>
      </div>

      <!-- 合同维护信息 -->
      <div class="maintain declare">
        <!-- <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="关联采购结果:"
                          prop="name">
              <div class="guanliandan">
                2021-07党竞争性谈判
                {{ruleForm.issue_1}}
              </div>
            </el-form-item>
          </el-col>
        </el-row> -->

        <el-row :gutter="60">
          <el-col :span="16">
            <el-form-item label="是否单价合同：" prop="shifou_djht">
              {{ ruleForm.shifou_djht == 0 ? "否" : "是" }}
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 付款金额 甲1 甲2 -->
        <div v-show="ruleForm.shifou_sfht != '0'">
          <div v-for="(item, index) in ruleForm.disanfang" :key="index + 1">
            <el-row :gutter="50" class="disanfang">
              <el-col :span="16">
                <el-form-item
                  :label="'甲:' + (index + 1)"
                  :prop="'disanfang.' + index + '.name_sdf'"
                >
                  {{ item.name_sdf }}
                </el-form-item>
              </el-col>
              <el-col :span="7" class="qwert">
                <el-form-item
                  label="付款金额:"
                  :prop="'disanfang.' + index + '.ampunt_sdf'"
                >
                  {{ formatMoney(parseInt(item.ampunt_sdf)) }}

                  <span> 元</span>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </div>
        <!-- 是否三方合同 -->
        <el-row :gutter="20">
          <el-col :span="6">
            <el-form-item label="是否三方合同：" prop="shifou_sfht">
              {{ ruleForm.shifou_sfht == 1 ? "是 " : "否 " }}
            </el-form-item>
          </el-col>
        </el-row>

        <!-- 合同名称 -->
        <!-- <el-row :gutter="60">
          <el-col :span="16">
            <el-form-item label="合同名称:"
                          prop="hetong_mc">
              <el-input :disabled='son.xiangqing__'
                        v-model="ruleForm.hetong_mc"></el-input>
            </el-form-item>
          </el-col>
        </el-row> -->
        <!-- 合同类别 -->

        <!-- 资金来源 -->
        <!-- <el-row :gutter="60">
          <el-col :span="8">
            <el-form-item label="资金来源:"
                          prop="zhijing_ly">
              <el-input v-model="ruleForm.zhijing_ly"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="专项科目:"
                          prop="zhaobiao_jg">
              <el-select v-model="ruleForm.zhaobiao_jg"
                         size="medium"
                         placeholder="请选择">
                <el-option v-for="item in options3"
                           :key="item.value"
                           :label="item.label"
                           :value="item.value">
                </el-option>
              </el-select>

            </el-form-item>
          </el-col>

        </el-row> -->
        <!-- 签订日期 -->
        <el-row :gutter="60">
          <el-col :span="8">
            <el-form-item label="签订日期：" prop="qianding_rqi">
              {{ ruleForm.qianding_rqi.substring(0, 10) }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="有效开始时间：" prop="youxiao_kssj">
              {{ ruleForm.youxiao_kssj.substring(0, 10) }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="合同结束时间：" prop="hetong_jssj">
              {{ ruleForm.hetong_jssj.substring(0, 10) }}
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 开户行 -->
        <el-row :gutter="60">
          <el-col :span="8">
            <el-form-item label="开户行：" prop="kaihu_h">
              {{ ruleForm.kaihu_h }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="开户行账号：" prop="kaihu_hzh">
              {{ ruleForm.kaihu_hzh }}
            </el-form-item>
          </el-col>
          <!-- <el-col :span="8">
            <div style="color:red;font-size:22px;line-height:40px;margin-left: -50px;">
              {{ruleForm.kaihu_hzh}}
            </div>
          </el-col> -->
        </el-row>
        <el-row :gutter="60">
          <el-col :span="8">
            <el-form-item label="到期是否提醒：" prop="">
              {{ ruleForm.dqsftx == 1 ? "是" : "否" }}
            </el-form-item>
          </el-col>
          <el-col :span="8" v-if="ruleForm.dqsftx == '1'">
            <el-form-item label="提醒时长：" prop="">
              提前{{ toChinesNum(ruleForm.tqjy) }}月
            </el-form-item>
          </el-col>
          <el-col :span="8" v-if="ruleForm.dqsftx == '1'">
            <el-form-item
              label="到期备注："
              prop=""
              v-if="ruleForm.remarks != ''"
            >
              {{ ruleForm.remarks }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row  :gutter="60">
          <el-col v-if="ruleForm.othernum != ''" :span="8">
            <el-form-item label="合同编号：" prop="">
              {{ ruleForm.othernum }}
            </el-form-item>
          </el-col>
          <el-col v-if="ruleForm.contractremarks != ''" :span="16">
            <el-form-item label="合同备注(临)：" prop="">
              {{ ruleForm.contractremarks }}
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 付款进度 -->
        <section>
          <div class="box" v-if="isRestart">
            <div
              style="
                width: 100%;
                height: 2px;
                background: #000000;
                opacity: 0.1;
                margin-bottom: 30px;
                margin-top: 10px;
              "
            ></div>
            <el-row
              v-for="(domain, index) in ruleForm.payListEntity"
              :key="index"
            >
              <el-col :span="24">
                <el-row :gutter="60">
                  <el-col :span="2">
                    <el-form-item
                      class="frobox"
                      :label="'第' + (index - 0 + 1) + '次付款'"
                      :prop="'payListEntity.' + index + '.planpaydate'"
                    >
                      <!-- {{ domain.planpaydate.substring(0, 10) }} -->
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item
                      label="付款时间："
                      :prop="'payListEntity.' + index + '.planpaydate'"
                    >
                      {{ domain.planpaydate.substring(0, 10) }}
                    </el-form-item>
                  </el-col>
                  <el-col :span="8" class="qwert">
                    <el-form-item
                      label="付款金额："
                      :prop="'payListEntity.' + index + '.amount'"
                    >
                      {{ domain.amount }}
                      <!-- {{formatMoney(parseInt(domain.amount))}} -->

                      <span> 元</span>
                    </el-form-item>
                  </el-col>

                  <el-col
                    :span="5"
                    class="qwert"
                    style="padding-right: 0px !important"
                  >
                    <el-form-item
                      label="付款比例："
                      :prop="'payListEntity.' + index + '.rate'"
                    >
                      <!-- <el-input style="width:100%;"
                                v-model="domain.rate"
                                :disabled='son.xiangqing__'
                                @blur="ratio(domain.rate, index)"></el-input> -->
                      <div>{{ domain.rate }} %</div>
                      <span> </span>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
            <div
              v-if="ruleForm.payListEntity.length - 0 == 0"
              style="
                width: 100%;
                height: 2px;
                background: #000000;
                opacity: 0.1;
                margin-bottom: 30px;
                margin-top: 10px;
              "
            ></div>
          </div>
        </section>

        <!-- 合同补充协议 -->
        <div v-if="son.xiangqing__">
          <el-row>
            <el-col>
              <div class="progress">
                <div class="name" style="width: 130px">合同补充协议</div>
                <div class="border_"></div>
              </div>
            </el-col>
          </el-row>
          <section>
            <p class="i" style="text-align: right"></p>
            <div class="box" v-if="isRestart">
              <el-row
                v-for="(domain, index) in ruleForm.payListEntity_xieyi"
                :key="index"
              >
                <el-col :span="24">
                  <el-row>
                    <el-col :span="8">
                      <p class="frobox">第{{ index + 1 }}次补录</p>
                    </el-col>
                  </el-row>
                  <el-row :gutter="60">
                    <el-col :span="8">
                      {{ domain.planpaydate }}
                    </el-col>
                    <el-col :span="8" class="qwert">
                      <el-form-item label="补充金额：">
                        {{ domain.amount }}
                        <span> 元</span>
                      </el-form-item>
                    </el-col>

                    <el-col
                      :span="7"
                      class="qwert"
                      style="padding-right: 0px !important"
                    >
                      <el-form-item label="补充名称：">
                        {{ domain.rate }}
                        <span>
                          <!-- % -->
                        </span>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="8">
                      <el-form-item label="合同扫描件:" prop="zbtzsFiles_1">
                        <myUpload
                          v-model="domain.Files"
                          :disabled="true"
                          accept=""
                        />
                        <!--  -->
                      </el-form-item>
                    </el-col>
                  </el-row>
                </el-col>
              </el-row>
            </div>
          </section>
        </div>
        <!-- <section class="sections">

          <div class="box files">
            <el-row :gutter="60">
              <el-col :span="8">
                <el-form-item label="合同扫描件："
                              prop="zbtzsFiles_1">
                  <myUpload v-model="ruleForm.zbtzsFiles_1"
                            :disabled='true'
                            :drag="true"
                            accept=".pdf," />

                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="审批表："
                              prop="pfbFiles_1">
                  <myUpload v-model="ruleForm.pfbFiles_1"
                            :drag="true"
                            :disabled='true'
                            accept=".pdf, .doc, .docx" />

                </el-form-item>
              </el-col>

              <el-col :span="8">
                <el-form-item label="其它附件："
                              prop="daili_Files_1">
                  <myUpload v-model="ruleForm.daili_Files_1"
                            :drag="true"
                            :disabled='true'
                            accept=".pdf, .doc, .docx" />

                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8"
                      v-if="list_details.isgovprocurement == '单价合同' || ruleForm.shifou_djht == 1">
                <el-form-item label="货物单价表:"
                              prop="huowu_djd">
                  <myUpload v-model="ruleForm.huowu_djd"
                            :drag="true"
                            :disabled='true'
                            accept="" />

                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </section> -->
        <el-row
          v-for="(domain, index) in ruleForm.payListEntity_xieyi"
          :key="index"
        >
          <el-col :span="24">
            <el-row>
              <el-col :span="8">
                <p class="frobox">第{{ index + 1 }}次补录</p>
              </el-col>
            </el-row>
            <el-row :gutter="60">
              <el-col :span="8">
                <el-form-item label="补充时间：">
                  {{ $moment(domain.planpaydate).format("YYYY-MM-DD") }}
                </el-form-item>
              </el-col>
              <el-col :span="8" class="qwert">
                <el-form-item
                  label="补充金额："
                  :prop="'payListEntity_xieyi.' + index + '.amount'"
                >
                  {{ domain.amount }}

                  <span> 元</span>
                </el-form-item>
              </el-col>
              <el-col
                :span="7"
                class="qwert"
                style="padding-right: 0px !important"
              >
                <el-form-item
                  label="补充名称："
                  :prop="'payListEntity_xieyi.' + index + '.rate'"
                  :rules="moreNotifyOjbectRules.rateVerification"
                >
                  {{ domain.rate }}
                  <span>
                    <!-- % -->
                  </span>
                </el-form-item>
              </el-col>
              <el-col
                :span="1"
                v-if="ruleForm.payListEntity_xieyi.length != 1"
                class="sanchu"
              >
                <i
                  class="el-icon-close"
                  style="cursor: pointer"
                  @click.prevent="
                    removeDomain_xieyi(domain, ruleForm.payListEntity_xieyi)
                  "
                ></i>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="9">
                <el-form-item
                  label="合同扫描件:"
                  prop="zbtzsFiles_1"
                  class="htsmj"
                >
                  <myUpload v-model="domain.Files" :drag="true" accept="" />
                </el-form-item>
              </el-col>
            </el-row>
          </el-col>
        </el-row>
        <section class="sections">
          <p class="i"><i class="el-icon-upload">&nbsp;</i>附件列表</p>
          <div class="box xxxxx">
            <div
              class="newFile"
              :class="{ newfiledelete: file_list.length == 0 }"
            >
              <div v-for="(g, h) in file_list" :key="h">
                <div class="qwerq" v-if="ruleForm.allFjEntityList[h]">
                  <img
                    class="icon_wj"
                    src="../../../assets/imgs/icon_wenjian.png"
                    alt=""
                  />
                  <div class="title">{{ g.name }} ：</div>
                  <myUpload
                    v-model="ruleForm.allFjEntityList[h]"
                    :drag="false"
                    class="myupload"
                    accept=""
                  />
                  <div style="margin-left: -20px">
                    <div
                      v-for="(n, m) in ruleForm.allFjEntityList[h]"
                      :key="m"
                      style="margin: 5px 0"
                    >
                      <el-button
                        type="primary"
                        style="height: 20px; line-height: 2px"
                        @click="btn_xiazai(n)"
                      >
                        <i
                          class="el-icon-download"
                          style="margin-top: -10px; font-size: 18px"
                        ></i>
                        <!-- <span style="">下 载</span> -->
                      </el-button>
                    </div>
                  </div>
                </div>
              </div>
              <el-row class="margins">
                <el-col style="padding: 0 20px 30px 20px; margin-top: 20px">
                  其他可上传附件：采购公告、采购结果公告确认表、计划备案表、采购评审专家抽取结果记录表，评审报告，评审结果确认函，成交公告，采购文件确认书，评审结果用户通知书，采购需求确认书，招标文件公告确认表，需求论证公告确认表，用户意见调查表，需求论证报告，竞争性磋商文件，
                </el-col>
              </el-row>
            </div>
          </div>
        </section>
        <el-row>
          <el-col
            style="padding: 0 20px 30px 20px"
            v-if="list_details.isgovprocurement != '单价合同'"
          >
            <!-- 其他可上传附件：采购公告、采购结果公告确认表、计划备案表、采购评审专家抽取结果记录表，评审报告，评审结果确认函，成交公告，采购文件确认书，评审结果用户通知书，采购需求确认书，招标文件公告确认表，需求论证公告确认表，用户意见调查表，需求论证报告，竞争性磋商文件， -->
          </el-col>
        </el-row>
      </div>

      <div class="heard" style="margin-top: 35px">
        <div class="h_left">
          <div>
            <i class="el-icon-s-claim" style="font-size: 28px"></i>
          </div>
          <div class="h_title">历史审核意见</div>
          <div>
            <img src="../../../assets/imgs/i4.png" alt="" />
          </div>
        </div>
      </div>
      <div style="margin: 20px 0" class="reject">
        <el-form :model="ruleForm" label-width="130px" class="demo-ruleForm">
          <div v-for="(i, k) in chcekEntityList" :key="k" class="">
            <el-row :gutter="0" style="padding: 0px 0px">
              <el-col :span="8">
                <el-form-item label="审核时间：" prop="">
                  {{ $moment(i.lastTime).format("YYYY-MM-DD HH:mm:ss") }}
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="审核状态：" prop="">
                  {{ i.state }}
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item
                  label="审核备注："
                  prop=""
                  v-if="i.state != '通过'"
                >
                  {{ i.comment }}
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-form>
      </div>
      <div style="height: 20px; width: 100%"></div>
    </el-form>
    <!-- 关联议题申报单按钮 -->

    <el-dialog
      title="选择议题申报单"
      append-to-body
      center
      width="1000px"
      :close-on-click-modal="false"
      :before-close="handleCloseDialog"
      :visible.sync="start.startDialogVisible"
    >
      <startDialog
        :visible.sync="start.startDialogVisible"
        v-if="start.startDialogVisible"
        :datas="types_btn"
        v-on:spot="spot"
      />
    </el-dialog>
    <div class="aaaaaaaaaa">
      <el-dialog
        :title="gongshi_data.name"
        :visible.sync="gongshi_show"
        width="70%"
        center
        append-to-body
        height="1000px"
      >
        <el-form label-width="110px" class="elasticframe my-search-form-box">
          <el-row>
            <el-col :span="8">
              <el-form-item label="公司简称：">
                <p>{{ gongshi_data.name }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="成立日期：">
                <p>{{ gongshi_data.estiblishTime }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="注册号：">
                <p>{{ gongshi_data.regNumber }}</p>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="注册资本：">
                <p>{{ gongshi_data.regCapital }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="纳税人识别号：">
                <p>{{ gongshi_data.taxNumber }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="人员规模：">
                <p>{{ gongshi_data.staffNumRange }}</p>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="公司地址：">
                <p>{{ gongshi_data.regLocation }}</p>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="经营范围：">
                <p style="white-space: normal; word-break: break-all">
                  {{ gongshi_data.businessScope }}
                </p>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button @click="gongshi_show = false">取 消</el-button>
          <el-button type="primary" @click="gongshiqueding">确 定</el-button>
        </span>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import myUpload from '@/components/global/my-upload/main.vue'
import startDialog from './startDialog.vue'
export default {
  name: '',

  components: { myUpload, startDialog },

  data() {
    let that = this

    var amountPayment = (rule, value, callback) => {
      console.log(value)
      let values = 0
      values = Number(value) + values
      console.log(values)
      if (values != Number(this.ruleForm.amount)) {
        return callback(new Error('付款金额总和必须等于采购金额'))
      }
      return callback()
    }
    var shortcutsThere = {
      text: '三个月',
      onClick(picker) {
        let _time = moment(
          moment(that.ruleForm.effectiveStartTime - 86400000).add(3, 'months')
        ).format('YYYY-MM-DD')
        picker.$emit('pick', _time)
      },
    }
    var shortcutsSix = {
      text: '六个月',
      onClick(picker) {
        let _time = moment(
          moment(that.ruleForm.effectiveStartTime).add(6, 'months')
        ).format('YYYY-MM-DD')
        picker.$emit('pick', _time)
      },
    }
    var shortcutsend = {
      text: '年底',
      onClick(picker) {
        let _time = moment(that.ruleForm.effectiveStartTime).format(
          'YYYY-12-31'
        )
        picker.$emit('pick', _time)
      },
    }
    var shortcutsOneyear = {
      text: '一年',
      onClick(picker) {
        let _time = moment(
          moment(that.ruleForm.effectiveStartTime - 86400000).add(12, 'months')
        ).format('YYYY-MM-DD')
        picker.$emit('pick', _time)
      },
    }
    var shortcutsTwoyear = {
      text: '两年',
      onClick(picker) {
        let _time = moment(
          moment(that.ruleForm.effectiveStartTime - 86400000).add(24, 'months')
        ).format('YYYY-MM-DD')
        picker.$emit('pick', _time)
      },
    }
    var shortcutsThereyear = {
      text: '三年',
      onClick(picker) {
        let _time = moment(
          moment(that.ruleForm.effectiveStartTime - 86400000).add(36, 'months')
        ).format('YYYY-MM-DD')
        picker.$emit('pick', _time)
      },
    }
    return {
      chcekEntityList: [
        {
          chid: 48375,
          cid: 33411,
          comment: "缺纪要或预算审批表",
          firstTime: "2020-12-18T11:07:12.000+0800",
          lastTime: "2020-12-18T11:07:12.000+0800",
          state: "不通过",
          yhdwid: 1008611,
          yhdwmc: "综合处",
          yhid: 1008623,
          yhxm: "杨可"
        }
      ],
      icon_shows_1: '',
      icon_shows_2: '',
      zhengzhe_s: false,
      issueId_1_childrenid: '',
      issueId_0_childrenid: '',
      gongshi_show: false,
      gongshi_data: [],
      xingzeng_type: '',
      start: {
        startDialogVisible: false,
      },
      labelPosition: 'right',
      isRestart: true,

      moreNotifyOjbectRules: {
        planpaydateVerification1: {
          required: true,
          message: ' ',
          trigger: 'blur',
        },
        stageVerification: {
          required: true,
          message: '内容不能为空',
          trigger: 'blur',
        },
        name_sdf: {
          required: true,
          message: '内容不能为空',
          trigger: 'blur',
        },
        ampunt_sdf: {
          required: true,
          message: '金额不能为空',
          trigger: 'blur',
        },
        planpaydateVerification: {
          required: true,
          message: ' ',
          trigger: 'blur',
        },
        amountVerification: [
          { required: true, validator: amountPayment, trigger: 'blur' },
        ],







      },
      types_btn: '',
      ruleForm: {
        zhongbiao_jg: '',
        payListEntity_xieyi: [

        ],
        issue_1: '',
        issue_0: '',
        issueId_0: '',
        issueId_1: '',
        contractremarks: '',
        name: '',
        yusuanjine: '100',
        zhongbiaojine: '',
        type: '',
        date_s: '',
        date_d: '',
        lianxi_r: '',
        danwei_mc: '',
        zhongbiao_gysxz: '',
        lianxi_dh: '',
        gongshi_zcdz: '',
        weituosouquan_date: '',
        zhaobiao_jg: '',
        zbtzsFiles: [],
        pfbFiles: [],
        daili_Files: [],
        allFjEntityList: [],
        amount: 1000000,
        payListEntity: [
          {
            id: 0,

            stage: '第1次付款',



            planpaydate: '',

            amount: 0,

            rate: '',
          },
        ],
        disanfang: [
          {
            name_sdf: '',
            ampunt_sdf: '',
          },
          {
            name_sdf: '',
            ampunt_sdf: '',
          },
        ],
        shifou_sfht: '0',
        jia1: '',
        fukuan_je1: '',
        jia2: '',
        fukuan_je2: '',
        hetong_mc: '',
        qianding_rqi: '',
        youxiao_kssj: '',
        hetong_jssj: '',
        kaihu_h: '',
        kaihu_hzh: '',
        zbtzsFiles: [],
        pfbFiles: [],
        daili_Files: [],
        zbtzsFiles_1: [],
        pfbFiles_1: [],
        daili_Files_1: [],
        huowu_djd: [],
        shifou_djht: '0',
        category: '货物',
      },

      rules: {},
      options: [
        {
          value: '选项1',
          label: '黄金糕',
        },
        {
          value: '选项2',
          label: '黄',
        },
      ],
      options1: [
        {
          value: '选项1',
          label: '1211',
        },
        {
          value: '选项2',
          label: '2221',
        },
      ],
      options2: [
        {
          value: '1',
          label: '是 / 三方合同',
        },
        {
          value: '0',
          label: '否 / 三方合同',
        },
      ],
      options3: [
        {
          value: '选项1',
          label: '5555',
        },
        {
          value: '选项2',
          label: '6666',
        },
      ],
      options4: [
        {
          value: '1',
          label: '是',
        },
        {
          value: '0',
          label: '否',
        },
      ],
      options6: ['月度付款', '季度付款'],
      options5: ['工程', '服务', '货物'],
      reportCycle: '月度付款',
      zhaobiao_jg_if: '',
      muban_as: {},
      file_list: [],
    }
  },
  props: {
    list_details: {
      type: Object,
      default: '',
    },
    son: {
      type: Object,
      default: '',
    },
  },

  created() {
    this.muban_a()
    console.log('son', this.son)
    console.log('list_details', this.list_details)
    if (
      this.son.govprocurement == '新增电子化平台' ||
      this.son.govprocurement == '新增10W以下' ||
      this.son.govprocurement == '新增10W-50W'
    ) {
      console.log('this.ruleForm.type新增电子化平台&&新增10W以下')
      this.ruleForm.payListEntity_xieyi = [

      ]
      this.xingzeng_type = 0
      this.ruleForm.type = this.son.govprocurement
      this.ruleForm.issue_1 = ''
      this.ruleForm.issue_0 = ''
      this.ruleForm.issueId_0 = ''
      this.ruleForm.issueId_1 = ''
      this.ruleForm.name = ''
      this.ruleForm.yusuanjine = ''
      this.ruleForm.zhongbiaojine = ''
      this.ruleForm.date_s = ''
      this.ruleForm.date_d = ''
      this.ruleForm.lianxi_r = ''
      this.ruleForm.danwei_mc = ''
      this.ruleForm.zhongbiao_gysxz = ''
      this.ruleForm.lianxi_dh = ''
      this.ruleForm.gongshi_zcdz = ''
      this.ruleForm.weituosouquan_date = ''
      this.ruleForm.zhaobiao_jg = ''
      this.ruleForm.zbtzsFiles = []
      this.ruleForm.pfbFiles = []
      this.ruleForm.daili_Files = []
      this.ruleForm.amount = ''
      this.ruleForm.payListEntity = [
        {

        },
      ]
      this.ruleForm.disanfang = [
        {
          name_sdf: '',
          ampunt_sdf: '',
        },
        {
          name_sdf: '',
          ampunt_sdf: '',
        },
      ]
      this.ruleForm.shifou_sfht = '0'
      this.ruleForm.jia1 = ''
      this.ruleForm.fukuan_je1 = ''
      this.ruleForm.jia2 = ''
      this.ruleForm.fukuan_je2 = ''
      this.ruleForm.hetong_mc = ''
      this.ruleForm.qianding_rqi = ''
      this.ruleForm.youxiao_kssj = ''
      this.ruleForm.hetong_jssj = ''
      this.ruleForm.kaihu_h = ''
      this.ruleForm.kaihu_hzh = ''
      this.ruleForm.zbtzsFiles = []
      this.ruleForm.pfbFiles = []
      this.ruleForm.daili_Files = []
      this.ruleForm.zbtzsFiles_1 = []
      this.ruleForm.pfbFiles_1 = []
      this.ruleForm.daili_Files_1 = []
      this.ruleForm.huowu_djd = []
      this.ruleForm.shifou_djht = '0'




    } else {
      this.xingzeng_type = 1
      this.reportCycle = this.son.reportCycle
      this.chcekEntityList = this.son.chcekEntityList.length - 0 > 0 ? this.son.chcekEntityList : []
      this.ruleForm.zhongbiao_jg = this.son.tenderee ? this.son.tenderee : ''
      this.ruleForm.zbjglxr = this.son.tendereeName ? this.son.tendereeName :''
      this.ruleForm.zbjglxjg = this.son.tendereeTel ? this.son.tendereeTel :''
      this.ruleForm.issueId_1 = this.son.tbYtid ? this.son.tbYtid : ''
      this.ruleForm.hylx = this.son.hymc ? this.son.hymc : ''

      this.ruleForm.issue_0 = this.son.issue ? this.son.issue : ''

      this.ruleForm.name = this.son.projectname ? this.son.projectname : ''

      this.ruleForm.type = this.son.govprocurement
        ? this.son.govprocurement
        : ''

      this.ruleForm.yusuanjine = this.son.budget ? this.son.budget : ''
      this.ruleForm.htlb = this.son.category


      this.ruleForm.danwei_mc = this.son.winner ? this.son.winner : ''

      this.ruleForm.lianxi_r = this.son.concects ? this.son.concects : ''

      this.ruleForm.lianxi_dh = this.son.tel ? this.son.tel : ''

      this.ruleForm.gongshi_zcdz = this.son.site ? this.son.site : ''
      //
      this.ruleForm.date_s = this.son.bidday ? this.son.bidday : ''
      this.ruleForm.zhongbiaojine = this.son.amount ? this.son.amount : ''
      this.ruleForm.zhongbiaojine = this.formatMoney(
        parseInt(this.ruleForm.zhongbiaojine)
      )
      this.ruleForm.zbtzsFiles = this.son.zbtzsFiles ? this.son.zbtzsFiles : []
      this.ruleForm.pfbFiles = this.son.pfbFiles ? this.son.pfbFiles : []
      console.log(this.ruleForm.pfbFiles)
      this.ruleForm.daili_Files = this.son.agentFiles ? this.son.agentFiles : []
      this.ruleForm.issue_1 = this.son.notification ? this.son.notification : ''
      this.ruleForm.shifou_sfht = this.son.sfdsf ? this.son.sfdsf : '0'
      this.ruleForm.hetong_mc = this.son.contractname
        ? this.son.contractname
        : ''
      this.ruleForm.shifou_djht = this.son.isunitprice
        ? this.son.isunitprice
        : ''
      this.ruleForm.qianding_rqi = this.son.agentTime ? this.son.agentTime : ''
      this.ruleForm.youxiao_kssj = this.son.startTime ? this.son.startTime : ''
      this.ruleForm.hetong_jssj = this.son.endTime ? this.son.endTime : ''
      this.ruleForm.tqjy = this.son.remarks ? this.son.remarks.slice(this.son.remarks.length - 1) + '' : '1'
      this.ruleForm.dqsftx = this.son.remind ? this.son.remind : '1'
      this.ruleForm.contractremarks = this.son.contractremarks ? this.son.contractremarks : ''
      this.ruleForm.othernum = this.son.othernum ? this.son.othernum : ''

      this.ruleForm.remarks = this.son.remarks ? this.son.remarks.slice(0, this.son.remarks.length - 2) : ''
      this.ruleForm.hetong_jssj = this.son.endTime ? this.son.endTime : ''
      this.ruleForm.kaihu_h = this.son.bank ? this.son.bank : ''
      this.ruleForm.kaihu_hzh = this.son.bankaccount ? this.son.bankaccount : ''
      this.ruleForm.zbtzsFiles_1 = this.son.smjFiles ? this.son.smjFiles : []
      this.ruleForm.pfbFiles_1 = this.son.spdFiles ? this.son.spdFiles : []
      this.ruleForm.daili_Files_1 = this.son.babFiles ? this.son.babFiles : []
      this.ruleForm.huowu_djd = this.son.unitPriceFiles
        ? this.son.unitPriceFiles
        : []
      this.ruleForm.payListEntity =
        this.son.payListEntity.length == 0
          ? this.ruleForm.payListEntity
          : this.son.payListEntity
      console.log(this.ruleForm.payListEntity)
      console.log(this.son.payListEntity)
      this.ruleForm.amount = this.ruleForm.zhongbiaojine
    }
    if (this.son.govprocurement == '新增电子化平台') {
      this.son.isgovprocurement = '电子化平台'
    }
    if (
      this.son.govprocurement == '新增10W以下' ||
      this.son.govprocurement == '新增10W-50W'
    ) {
      this.son.isgovprocurement = '非政采'
    }

    if (this.son.supplementList.length - 0 != 0) {
      console.log('补录数据', this.son.supplementList.length)
      this.ruleForm.payListEntity_xieyi = []
      this.son.supplementList.forEach((data) => {
        this.ruleForm.payListEntity_xieyi.push({
          planpaydate: data.supplementDate,
          amount: data.amount,
          rate: data.title,
          Files: data.blFiles,
        })
      })
    } else {
      console.log('补录数据', this.son.supplementList.length)
      this.ruleForm.payListEntity_xieyi = [

      ]
    }
    if (this.son.dsfdomains) {
      this.ruleForm.disanfang = []
      this.son.dsfdomains.forEach((data) => {
        this.ruleForm.disanfang.push({
          name_sdf: data.jfname,
          ampunt_sdf: data.amount,
        })
      })
    } else {
      this.ruleForm.disanfang = [
        {
          name_sdf: '',
          ampunt_sdf: '',
        },
        {
          name_sdf: '',
          ampunt_sdf: '',
        },
      ]
    }

    if (this.son.bulu__ == 'query' && this.ruleForm.zhongbiao_jg == '') {
      this.zhaobiao_jg_if = false
    } else {
      this.zhaobiao_jg_if = true
    }

  },

  watch: {
    ruleForm: {
      handler(val, oldVal) {
        console.log('b.c: ' + val, oldVal)
        if (
          val.name != '' && //
          val.yusuanjine != '' &&
          val.date_s != '' &&
          val.zhongbiaojine != '' &&
          val.danwei_mc != '' &&
          val.lianxi_r != '' &&
          val.lianxi_dh != '' &&
          val.gongshi_zcdz != '' &&
          val.zhongbiao_jg != '' &&
          val.zbtzsFiles.length != 0 &&
          val.pfbFiles.length != 0 &&
          val.daili_Files.length != 0
        ) {
          this.icon_shows_1 = true
        } else {
          this.icon_shows_1 = false
        }
        var jia_s = true
        if (val.shifou_sfht == '1') {
          val.disanfang.forEach((data) => {
            console.log(data)
            if (data.name_sdf == '' || data.ampunt_sdf.ampunt_sdf == '') {
              jia_s = false
              return
            }
          })
        }
        var fukuan_s = true
        if (this.son.isunitprice == 0 && this.ruleForm.shifou_djht == 0) {
          console.log(222222222, val)
          val.payListEntity.forEach((data) => {
            if (data.amount == 0 || data.planpaydate == '' || data.rate == '') {
              fukuan_s = false
              return
            }
          })
          if (
            val.issue_1 != '' &&
            jia_s &&
            val.qianding_rqi != '' &&
            val.youxiao_kssj != '' &&
            val.hetong_jssj != '' &&
            val.kaihu_h != '' &&
            val.kaihu_hzh != '' &&
            fukuan_s &&
            val.zbtzsFiles_1.length != 0 &&
            val.pfbFiles_1.length != 0 &&
            val.daili_Files_1.length != 0
          ) {
            this.icon_shows_2 = true
          } else {
            this.icon_shows_2 = false
          }
        }
        if (this.son.isunitprice == 0 && this.ruleForm.shifou_djht == 1) {
          console.log(33333333)
          val.payListEntity.forEach((data) => {
            if (data.amount == 0 || data.planpaydate == '' || data.rate == '') {
              fukuan_s = false
              return
            }
          })
          if (
            val.issue_1 != '' &&
            jia_s &&
            val.qianding_rqi != '' &&
            val.youxiao_kssj != '' &&
            val.hetong_jssj != '' &&
            val.kaihu_h != '' &&
            val.kaihu_hzh != '' &&
            fukuan_s &&
            val.zbtzsFiles_1.length != 0 &&
            val.pfbFiles_1.length != 0 &&
            val.daili_Files_1.length != 0 &&
            val.huowu_djd.length != 0
          ) {
            this.icon_shows_2 = true
          } else {
            this.icon_shows_2 = false
          }
        }
      },
      deep: true, //true 深度监听
    },
  },
  mounted() {
    setTimeout(() => {
      this.new_file()
    }, 300);
  },
  methods: {
    toChinesNum(num) {
      let changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']; //changeNum[0] = "零"
      let unit = ["", "十", "百", "千", "万"];
      num = parseInt(num);
      let getWan = (temp) => {
        let strArr = temp.toString().split("").reverse();
        let newNum = "";
        for (var i = 0; i < strArr.length; i++) {
          newNum = (i == 0 && strArr[i] == 0 ? "" : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum;
        }
        return newNum;
      }
      let overWan = Math.floor(num / 10000);
      let noWan = num % 10000;
      if (noWan.toString().length < 4) noWan = "0" + noWan;
      return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
    },

    blur_dainhua() {
      if (this.ruleForm.lianxi_dh != '') {
        if (
          !/([1]\d{10}|([\(（]?0[0-9]{2,3}[）\)]?[-]?)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?)/.test(
            this.ruleForm.lianxi_dh
          )
        ) {
          console.log(11111)
          this.zhengzhe_s = true
        } else {
          console.log(22222)
          this.zhengzhe_s = false
        }
      }



    },

    handleClose_gongshi() {





    },

    new_file() {
      console.log('合同类别 -- this.son.isgovprocurement')
      this.$axios.get('/info/contractVo/getFjInfo/' + this.son.classify).then((res) => {
        console.log('附件列表', res, this.son.allFjEntityList)
        if (res) {
          this.file_list = res.data.data
          if (this.son.allFjEntityList) {
            var flise = this.son.allFjEntityList
            this.ruleForm.allFjEntityList = []
            console.log(this.file_list)
            for (let nm in this.file_list) {
              let Files = []
              for (let jk in flise) {
                if (flise[jk].type - 0 == this.file_list[nm].code - 0) {
                  Files.push(flise[jk])
                  this.ruleForm.allFjEntityList[nm - 0] = Files
                }
              }
            }
          }
          this.ruleForm.amount = this.$utils.$formattMoney(this.ruleForm.amount)
          this.ruleForm.payListEntity.forEach((p) => {
            p.amount = this.$utils.$formattMoney(p.amount)
          })
          console.log(this.ruleForm)
        }
      })
    },
    btn_xiazai(e) {
      this.$utils.$download(e.url, e.name)
    },
    btn_fanhui(formName) {
      console.log(111111111)
      console.log(this.$parent.$parent)
      this.$parent.$parent.apigetTableData_new()
      this.$parent.$parent.dialogVisibleadd_1 = false



    },
    handleCloseDialog(done) {
      this.$router.replace(this.$route.path)
      done()
    },
    deleteSyyt(e) {
      if (e == 0) {
        this.ruleForm.issue_0 = ''
        this.ruleForm.issueId_0 = ''
        this.ruleForm.issueId_0_childrenid = ''
        this.ruleForm.yusuanjine = ''
      }
      if (e == 1) {
        this.ruleForm.issue_1 = ''
        this.ruleForm.issueId_1 = ''
        this.ruleForm.issueId_1_childrenid = ''
        this.ruleForm.yusuanjine = ''
      }
    },
    spot: function (data) {
      console.log(data)
      if (this.types_btn == 0) {
        this.ruleForm.issue_0 = data.ytmc
        this.ruleForm.issueId_0 = parseInt(data.ytid)
        this.ruleForm.yusuanjine = this.formatMoney(parseInt(data.budgetMoney))
        this.ruleForm.name = data.projectname
        if (data.new_children) {
          this.ruleForm.category = data.new_children.category
          this.ruleForm.name = data.new_children.xmmc
          this.ruleForm.issueId_0_childrenid = data.new_children.bid
          this.ruleForm.issue_0 =
            data.ytmc + ' —— 分包 : ' + data.new_children.xmmc
          this.ruleForm.yusuanjine = this.formatMoney(
            parseInt(data.new_children.budgetMoney)
          )
        }
      }
      if (this.types_btn == 1) {
        this.ruleForm.issue_1 = data.ytmc
        this.ruleForm.issueId_1 = parseInt(data.ytid)

        if (data.new_children) {
          this.ruleForm.yusuanjine = this.formatMoney(
            parseInt(data.new_children.budgetMoney)
          )


          this.ruleForm.issueId_1_childrenid = data.new_children.ytid
          this.ruleForm.issue_1 =
            data.ytmc + ' —— 分包 : ' + data.new_children.xmmc
        }
      }
    },
    formatMoney(number, decimals = 2) {
      let num = parseFloat(number).toFixed(decimals)
      num = num.toString().replace(/\$|\,/g, '')
      if (isNaN(num)) {
        num = '0'
      }
      let sign = num == (num = Math.abs(num))
      num = Math.floor(num * 100 + 0.50000000001)
      let cents = num % 100
      num = Math.floor(num / 100).toString()
      if (cents < 10) {
        cents = '0' + cents
      }
      for (let i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) {
        num =
          num.substring(0, num.length - (4 * i + 3)) +
          ',' +
          num.substring(num.length - (4 * i + 3))
      }
      return (sign ? '' : '-') + num + '.' + cents
    },
    yusuan(e) {
      this.ruleForm.amount = e
      console.log(this.ruleForm.amount)
      var filse = 0
      this.ruleForm.zbtzsFiles.forEach((data) => {
        if (data.name == '') {
          filse = 1
          return
        }
      })
      this.ruleForm.pfbFiles.forEach((data) => {
        if (data.name == '') {
          filse = 1
          return
        }
      })
      this.ruleForm.daili_Files.forEach((data) => {
        if (data.name == '') {
          filse = 1
          return
        }
      })
    },


    generationissues(e) {
      console.log(this.ruleForm)
      if (e == 0) {
      }
      this.types_btn = e
      this.start.startDialogVisible = true
    },
    submitForm(formName) {
      if (this.ruleForm.lianxi_dh != '') {
        if (
          !/([1]\d{10}|([\(（]?0[0-9]{2,3}[）\)]?[-]?)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?)/.test(
            this.ruleForm.lianxi_dh
          )
        ) {
          this.$message.error('请输入正确的联系电话')
          return
        }
      }
      if (this.son.xingzeng_10W == false) {
        if (this.ruleForm.yusuanjine > 100000) {
          this.$message.error('新增10W以下金额不能超过10W')
          return
        }
      }

      var isgovprocurement = ''
      var classify = ''
      if (
        this.son.govprocurement == '新增电子化平台' ||
        this.son.govprocurement == '新增10W以下' ||
        this.son.govprocurement == '新增10W-50W'
      ) {
        this.list_details.cid = null
      }
      if (this.son.govprocurement == '新增电子化平台') {
        this.ruleForm.type = '电子化平台'
        isgovprocurement = '电子化平台'
        classify = '电子化平台'
      }
      if (this.son.govprocurement == '新增10W以下') {
        classify = '非政府采购合同（10万以下）'
      }
      if (this.son.govprocurement == '新增10W-50W') {
        classify = '非政采10W-50W'
      }
      if (
        this.son.govprocurement == '新增10W以下' ||
        this.son.govprocurement == '新增10W-50W'
      ) {
        this.ruleForm.type = '非政采'
        isgovprocurement = '非政采'
      }
      var payListEntitys = []
      var supplementList = []
      var dsfdomains = []
      var num = 0
      var amounts = 0

      this.ruleForm.payListEntity.forEach((data) => {
        console.log(data)
        amounts = data.amount + amounts
        if (data.amount == '') {
          data.amount = 0
        }
        if (data.amount != '') {
          if (data.planpaydate == '' || data.rate == '') {
            num = 1
            return false
          }
        }
        if (data.planpaydate != '') {
          if (data.amount == '' || data.rate == '') {
            num = 1
            return false
          }
        }
        if (data.rate != '') {
          if (data.planpaydate == '' || data.amount == '') {
            num = 1
            return false
          }
        }

        payListEntitys.push({
          amount: data.amount,
          cid: this.list_details.cid,
          planpaydate: data.planpaydate,
          rate: data.rate,
          stage: data.stage,
        })
      })

      if (
        this.ruleForm.payListEntity.length == 1 &&
        this.ruleForm.payListEntity[0].amount == 0 &&
        this.ruleForm.payListEntity[0].planpaydate == '' &&
        this.ruleForm.payListEntity[0].rate == ''
      ) {
        payListEntitys = []
        num = 0
      }

      this.ruleForm.payListEntity_xieyi.forEach((data) => {
        console.log(data)
        if (data.amount == '') {
          data.amount = 0
        }
        if (data.amount != '') {
          if (
            data.planpaydate == '' ||
            data.rate == '' ||
            data.Files.length == 0
          ) {
            num = 2
            return false
          }
        }
        if (data.planpaydate != '') {
          if (data.amount == '' || data.rate == '' || data.Files.length == 0) {
            num = 2
            return false
          }
        }
        if (data.rate != '') {
          if (
            data.planpaydate == '' ||
            data.amount == '' ||
            data.Files.length == 0
          ) {
            num = 2
            return false
          }
        }
        if (data.Files.length == 0) {
          if (data.planpaydate == '' || data.amount == '' || data.rate == '') {
            num = 2
            return false
          }
        }
        supplementList.push({
          amount: data.amount,
          cid: this.list_details.cid,
          supplementDate: data.planpaydate,
          title: data.rate,
          stage: data.stage,
          blFiles: data.Files,
        })
      })
      console.log(this.ruleForm.payListEntity_xieyi)
      if (
        this.ruleForm.payListEntity_xieyi.length == 1 &&
        this.ruleForm.payListEntity_xieyi[0].amount == 0 &&
        this.ruleForm.payListEntity_xieyi[0].planpaydate == '' &&
        this.ruleForm.payListEntity_xieyi[0].rate == '' &&
        this.ruleForm.payListEntity_xieyi[0].Files.length == 0
      ) {
        supplementList = []
        num = 0
      }
      if (num == 1) {
        this.$message.error('请正确并完整填写付款进度')
        return
      }
      if (num == 2) {
        this.$message.error('请正确并完整填写合同补充协议')
        return
      }
      console.log(amounts, this.ruleForm.zhongbiaojine)
      if (amounts != this.ruleForm.zhongbiaojine && amounts != 0) {
        this.$message.error('付款金额总和须等于采购金额')
        return
      }
      if (this.ruleForm.shifou_sfht == '1') {
        this.ruleForm.disanfang.forEach((data) => {
          dsfdomains.push({
            jfname: data.name_sdf,
            amount: data.ampunt_sdf,
            cid: this.list_details.cid,
          })
        })
      }
      console.log(num)

      var post_data = {
        reportCycle: this.reportCycle,
        classify: classify,

        isgovprocurement: isgovprocurement,
        issueId: this.ruleForm.issueId_0,
        ytCid: this.ruleForm.issueId_0_childrenid,
        cid: this.list_details.cid,
        supplementList: supplementList,
        issue: this.ruleForm.issue_0,
        projectname: this.ruleForm.name,
        govprocurement: this.ruleForm.type,
        budget: this.ruleForm.yusuanjine == '' ? '0' : this.ruleForm.yusuanjine,

        tenderee: this.ruleForm.zhongbiao_jg, //中标机构
        winner: this.ruleForm.danwei_mc,
        concects: this.ruleForm.lianxi_r,
        category: this.ruleForm.category,
        tel: this.ruleForm.lianxi_dh,
        site: this.ruleForm.gongshi_zcdz,
        bidday: this.ruleForm.date_s, //中标日期
        amount:
          this.ruleForm.zhongbiaojine == '' ? '0' : this.ruleForm.zhongbiaojine, //中标金额
        zbtzsFiles: this.ruleForm.zbtzsFiles,
        pfbFiles: this.ruleForm.pfbFiles,
        agentFiles: this.ruleForm.daili_Files,
        reportCycle: '月',


        notification: this.ruleForm.issue_1,
        tbYtid: this.ruleForm.issueId_1,
        sfdsf: this.ruleForm.shifou_sfht,
        dsfdomains: dsfdomains,
        contractname: this.ruleForm.hetong_mc,
        isunitprice: this.ruleForm.shifou_djht,
        agentTime: this.ruleForm.qianding_rqi,
        startTime: this.ruleForm.youxiao_kssj,
        endTime: this.ruleForm.hetong_jssj,
        bank: this.ruleForm.kaihu_h,
        bankaccount: this.ruleForm.kaihu_hzh,

        payListEntity: payListEntitys,
        smjFiles: this.ruleForm.zbtzsFiles_1,
        spdFiles: this.ruleForm.pfbFiles_1,
        babFiles: this.ruleForm.daili_Files_1,
        unitPriceFiles: this.ruleForm.huowu_djd,
      }
      setTimeout(() => {

        this.Forms(post_data)
      }, 100)
    },






    muban_a() {
      this.$axios.get('/info/contractVo/getFileDj').then((res) => {
        this.muban_as = res.data.data[0]
        console.log(this.muban_as)
        this.muban_as.http_ =
          'http://192.168.1.205:80/download/' + this.muban_as.url
      })
    },
    danwei_mc(e) {


      this.$axios
        .post(
          '/info/contractCom/getCompanyInfo?name=' + this.ruleForm.danwei_mc
        )
        .then((res) => {
          console.log(res)
          if (res.data.data) {
            this.gongshi_show = true
            this.gongshi_data = res.data.data
          }
        })
    },
    Forms(e) {
      if (this.son.bulu__ == 'supple') {
        console.log(1111) //增加补录
        this.$axios.post('/info/contractVo/doSupple', e).then((res) => {

          if (res.data.data) {
            this.$message({
              message: '保存成功',
              type: 'success',
            })
            setTimeout(() => {
              this.btn_fanhui()
            }, 2300)
          }
        })
      } else {
        this.$axios.post('/info/contractVo/doSaveOrUpdate', e).then((res) => {

          if (res.data.data) {
            this.$message({
              message: '保存成功',
              type: 'success',
            })
            setTimeout(() => {
              this.btn_fanhui()
            }, 2300)
          }
        })
      }
    },
    payment(item, index) {
      item = Number(item)
      if (item > 0) {
        this.ruleForm.payListEntity[index].rate = Math.round(
          (item / this.ruleForm.amount) * 100
        )

      }
    },

    ratio(item, index) {
      console.log(item, index, this.ruleForm.payListEntity)
      let num = 0
      this.ruleForm.payListEntity.forEach((itema) => {
        num += Number(itema.rate)
      })
      this.ruleForm.payListEntity[index].amount =
        (this.ruleForm.amount * item) / 100

      if (num === 100) {
        let nummoney = 0
        this.isRestart = false
        console.log(this.ruleForm.payListEntity)
        this.ruleForm.payListEntity.forEach((items) => {


          nummoney += parseInt(Number(items.amount) * 100)
        })

        let len = this.ruleForm.payListEntity.length - 1





        setTimeout(() => {
          this.isRestart = true
        }, 300)
      } else {
        let ratioSumall = Number(0)
        this.ruleForm.payListEntity.map((item) => {
          ratioSumall += Number(item.rate)
        })
        if (ratioSumall > 100) {
          this.$message.error('付款比例不能大于100')
        }
        if (item > 0 && item <= 100) {
          this.isRestart = false




          console.log(this.ruleForm.payListEntity[index].amount)
          let numberMoney = Number((item / 100) * this.ruleForm.amount)
          console.log(numberMoney)
          numberMoney = Number(numberMoney.toFixed(2))
          console.log(numberMoney)


          console.log(this.ruleForm.payListEntity)
          setTimeout(() => {
            this.isRestart = true
          }, 300)
        }
      }

    },

    newlyAdded() {
      this.ruleForm.payListEntity.push({
        stage: '第' + (this.ruleForm.payListEntity.length + 1) + '次付款',
        planpaydate: '',
        amount: 0,
        rate: '',
        id: this.ruleForm.payListEntity.length,
      })
    },
    newlyAdded_xieyi() {
      this.ruleForm.payListEntity_xieyi.push({

      })
    },
    btn_dsf_zj() {
      this.ruleForm.disanfang.push({
        name_sdf: '',
        ampunt_sdf: '',
      })
    },
    niandu_fukuan() {
      //年度
      this.ruleForm.payListEntity = []
      for (let i = 0; i < 12; i++) {
        this.ruleForm.payListEntity.push({
          stage: '',
          planpaydate: '',
          amount: 0,
          rate: '',
        })
      }
    },
    jidu_fukuan() {

      this.ruleForm.payListEntity = []
      for (let i = 0; i < 4; i++) {
        this.ruleForm.payListEntity.push({
          stage: '第' + (this.ruleForm.payListEntity.length + 1) + '次付款',
          planpaydate: '',
          amount: 0,
          rate: '',
        })
      }
    },

    yuedu_fukuan() {

      this.ruleForm.payListEntity = []
      for (let i = 0; i < 12; i++) {
        this.ruleForm.payListEntity.push({
          stage: '第' + (this.ruleForm.payListEntity.length + 1) + '次付款',
          planpaydate: '',
          amount: 0,
          rate: '',
        })
      }






    },
    gongshiqueding() {
      this.gongshi_show = false
      this.ruleForm.danwei_mc = this.gongshi_data.name
      this.ruleForm.lianxi_r = this.gongshi_data.legalPersonName

      this.ruleForm.gongshi_zcdz = this.gongshi_data.regLocation
    },

    removeDomain(item, stage) {
      if (stage.length === 1) {
        return
      }
      let index = this.ruleForm.payListEntity.indexOf(item)
      if (index !== -1) {
        this.ruleForm.payListEntity.splice(index, 1)

        for (let i in this.ruleForm.payListEntity) {
          this.ruleForm.payListEntity[i].stage =
            '第' + (parseInt(i) + 1) + '次付款'
        }
      }
    },

    removeDomain_xieyi(item, stage) {
      if (stage.length === 1) {
        return
      }
      let index = this.ruleForm.payListEntity_xieyi.indexOf(item)
      if (index !== -1) {
        this.ruleForm.payListEntity_xieyi.splice(index, 1)

        for (let i in this.ruleForm.payListEntity_xieyi) {
          this.ruleForm.payListEntity_xieyi[i].stage =
            '第' + (parseInt(i) + 1) + '次付款'
        }
      }
    },
    removeDomain_1(item, stage) {
      if (stage.length === 2) {
        return
      }
      let index = this.ruleForm.disanfang.indexOf(item)
      if (index !== -1) {
        this.ruleForm.disanfang.splice(index, 1)
        for (let i in this.ruleForm.payListEntity) {
          this.ruleForm.payListEntity[i].stage =
            '第' + (parseInt(i) + 1) + '次付款'
        }
      }
    },
  },
}
</script>

<style lang='scss' scoped>
/deep/ .el-dialog {
  .el-row {
    margin-top: 20px;
  }
  .el-dialog__footer {
    text-align: right;
  }
}
.qitawenjian {
  height: 100%;

  box-shadow: 0px 1px 7px 0px rgba(77, 71, 83, 0.2);
  padding: 20px;
  margin-top: 16px;
  border-radius: 5px;
  .icon_wj {
    width: 20px;
    margin-left: 10px;
  }
  .title {
    margin-top: 22px;
  }
 ::v-deep .upload-demo {
    margin-left: 8px;
  }
}
.reject {
  font-family: "Microsoft YaHei", "\5FAE\8F6F\96C5\9ED1", "SimHei";
  font-size: 14px;
  border-radius: 10px;
  padding: 15px 30px;
  box-shadow: 0px 1px 7px 0px rgba(77, 71, 83, 0.2);
}
#box {
  .lianxi_dh_zz {
    font-size: 12px;
    color: rgb(250, 82, 82);
    height: 26px;
    line-height: 26px;
    padding-left: 15px;
  }
  .dialog_gongshi {
    background: #f5fbff;
  }
  .guanliandan {
    width: 100%;
    height: 32px;
    margin-top: 6px;
    line-height: 32px;
    background: #e5f1fb;
    border-radius: 4px;
    color: #409eff;
    padding: 0 20px;
  }
  .newfiledelete {
    min-height: 45px !important;
  }
  .newFile {
    padding: 20px;
    height: 100%;
    position: relative;
    min-height: 317px;

    .qwerq {
      position: relative;

      box-shadow: 0px 1px 7px 0px rgba(0, 0, 0, 0.25);
      padding-bottom: 15px;
      padding-top: 15px;
      margin-bottom: 10px;
      padding-left: 20px;
      margin-top: 15px;
      border-radius: 5px;
      .icon_wj {
        width: 20px;
        margin-right: 10px;
        img {
          width: 20px;
        }
      }

      .myupload {
        padding-left: 10px;
        display: flex;
        width: calc(100% - 260px);
        align-items: center;
        margin-top: -3px;
       ::v-deep .el-row {
          position: absolute;
          right: 0;
        }
       ::v-deep .my-upload-info {
          width: 100%;
        }
       ::v-deep.el-icon-delete-solid {
          position: absolute;
          right: 0px;
        }
       ::v-deep .my-upload {
          margin: 0;
        }
       ::v-deep .info_item {
          width: calc(100% - 60px);

          overflow: hidden;
          .el-button {
            margin-top: 5px;
            padding: 0px;
          }
        }
      }
      box-sizing: border-box;

      display: flex;
      align-items: center;
      padding-left: 35px;
      .title {
        min-width: 160px;
        max-width: 200px;
        text-align: right;
      }
    }
   ::v-deep .el-tooltip {
      font-size: 16px;
    }
   ::v-deep .el-button--text {
      min-height: 18px;
    }
    .qoqoqo {
      width: 25%;
      height: 91.2%;
      display: flex;

      box-sizing: border-box;
     ::v-deep .el-upload {
        width: 100%;
        .el-upload-dragger {
          width: 100%;
        }
      }
      position: absolute;
      top: 20px;
      right: -10px;
      display: block;
      .title {
        position: absolute;
        top: 15px;
        left: 60px;
      }
      .myupload_code_61 {
        width: 100%;
        height: 100%;
        display: block;
      }
     ::v-deep.el-row {
        position: relative !important;
        margin: 20px;
      }
     ::v-deep .btn {
        margin: 5px 0 !important;
      }
     ::v-deep .my-upload-info {
        height: calc(100% - 190px);

        overflow-y: auto;
      }
    }
    .qoqoqo {
      width: 23%;
      height: 91.2%;

      box-sizing: border-box;
     ::v-deep .el-upload {
        width: 100%;
        .el-upload-dragger {
          width: 100%;
        }
      }
      position: absolute;
      top: 20px;
      right: 20px;
      display: block;
      .title {
        position: absolute;
        top: 15px;
        left: 60px;
      }
      .myupload_code_61 {
        width: 100%;
        height: 100%;
        display: block;
      }
     ::v-deep.el-row {
        position: relative !important;
        margin: 20px;
      }
     ::v-deep .btn {
        margin: 5px 0 !important;
      }
     ::v-deep .my-upload-info {
        height: calc(100% - 190px);

        overflow-y: auto;
      }
    }
  }
  .newfiledelete {
    min-height: 45px;
  }
  .titles {
   ::v-deep .el-form-item__content {
      display: flex;
    }
  }
  .yuanmmp {
   ::v-deep .el-form-item__content {
      display: flex;
    }
  }
  .heard {
    display: flex;
    justify-content: space-between;
    .h_left {
      display: flex;
      align-items: center;
      font-size: 18px;
      font-family: Microsoft YaHei, Microsoft YaHei-Regular;
      font-weight: bold;
      color: #409eff;
      .h_title {
        margin: 0 12px;
      }
    }
    .h_button {
      position: fixed;
      top: 85px;
      right: 50px;
      z-index: 99;
      button {
        padding-left: 25px;
        padding-right: 25px;
      }
    }
  }
  .declare {
    .notes {
      color: red;
    }
    .aaa {
      position: relative;
      z-index: 2;
    }
    .danweiyuan {
      position: relative;

      top: 10px;
      left: -20px;
      z-index: 0;
    }
    padding: 31px 50px 0px 30px;
    margin-top: 28px;

    opacity: 1;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0px 1px 7px 0px rgba(77, 71, 83, 0.2);
    .list_nav {
      display: flex;
      align-items: center;
      margin-bottom: 20px;
      .title_l {
        width: 128px;
        box-sizing: border-box;
        text-align: right;
        padding-left: 12px;
        margin-right: 12px;
      }
    }
  }
  p {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px !important;
  }
  .frobox {
    width: 128px;
    text-align: right;
    font-size: 14px;
    font-family: Microsoft YaHei, Microsoft YaHei-Regular;
    font-weight: 400;
    line-height: 40px;
    height: 40px;
    color: #409eff;

    margin-bottom: 22px;
   ::v-deep .el-form-item__label {
      color: #409eff;
    }
  }
  .sanchu {
    font-size: 20px;
    height: 38px;

    padding-right: 0 !important;
    line-height: 38px;
  }
 ::v-deep .el-form-item__label {
    width: 140px !important;
  }
 ::v-deep .el-select {
    width: 100% !important;
  }
 ::v-deep .el-date-editor {
    width: 100% !important;
  }
  .qwert {
    white-space: nowrap;
   ::v-deep .el-form-item__content {
      white-space: nowrap;
    }
  }
  .files {
   ::v-deep .el-form-item__label {
      line-height: 48px;
    }
  }
  .qingshiyt {
   ::v-deep .el-form-item__content {
      display: flex;
    }
  }
}
.my-search-form-box {
  display: block;
  background: white;
  border-left: 5px solid white;
}
.disanfang {
  .qwert {
    padding-right: 0 !important;
  }
}
.sections {
  .i {
    text-align: left;
    font-size: 18px !important;
    color: rgb(0, 153, 255);
    opacity: 0.8;
  }
}
.maintain {
  margin-bottom: 10px;
  .progress {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    .name {
      font-size: 18px;
      color: #409eff;
      width: 110px;
      font-weight: bold;
    }
    .border_ {
      width: 100%;
      height: 2px;
      opacity: 0.1;
      margin-right: 1.5%;
      padding: 0 20px;
      background: #000000;
    }
  }
}

/deep/ .el-icon-delete-solid {
  display: none;
}
/deep/ .el-button--small {
  display: none;
}
/deep/ .el-upload-dragger {
  display: none;
}
/deep/ .el-row--flex {
  display: none;
}
/deep/ .myupload {
  margin-top: 20px;
}
.list_hh_class {
  cursor: pointer;
  margin: 10px 0;
  font-size: 16px;
}
.htsmj {
 ::v-deep .el-button {
    padding: 13px;
  }
}
</style>
